# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AppEngine.V1.Model.HealthCheck do
  @moduledoc """
  Health checking configuration for VM instances. Unhealthy instances are killed and replaced with new instances. Only applicable for instances in App Engine flexible environment.

  ## Attributes

  *   `checkInterval` (*type:* `String.t`, *default:* `nil`) - Interval between health checks.
  *   `disableHealthCheck` (*type:* `boolean()`, *default:* `nil`) - Whether to explicitly disable health checks for this instance.
  *   `healthyThreshold` (*type:* `integer()`, *default:* `nil`) - Number of consecutive successful health checks required before receiving traffic.
  *   `host` (*type:* `String.t`, *default:* `nil`) - Host header to send when performing an HTTP health check. Example: "myapp.appspot.com"
  *   `restartThreshold` (*type:* `integer()`, *default:* `nil`) - Number of consecutive failed health checks required before an instance is restarted.
  *   `timeout` (*type:* `String.t`, *default:* `nil`) - Time before the health check is considered failed.
  *   `unhealthyThreshold` (*type:* `integer()`, *default:* `nil`) - Number of consecutive failed health checks required before removing traffic.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :checkInterval => String.t() | nil,
          :disableHealthCheck => boolean() | nil,
          :healthyThreshold => integer() | nil,
          :host => String.t() | nil,
          :restartThreshold => integer() | nil,
          :timeout => String.t() | nil,
          :unhealthyThreshold => integer() | nil
        }

  field(:checkInterval)
  field(:disableHealthCheck)
  field(:healthyThreshold)
  field(:host)
  field(:restartThreshold)
  field(:timeout)
  field(:unhealthyThreshold)
end

defimpl Poison.Decoder, for: GoogleApi.AppEngine.V1.Model.HealthCheck do
  def decode(value, options) do
    GoogleApi.AppEngine.V1.Model.HealthCheck.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AppEngine.V1.Model.HealthCheck do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
